home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-04 | 2.1 KB | 88 lines | [TEXT/KAHL] |
- /********************************************************* DEFINITION
- DATE: 9/23/93
- AUTHOR: Eric R. Rosé
-
- CLASS: CPPButton
-
- SUPERCLASS: CPPVisualObject
-
- This C++ class manages a Button control
-
- ********************************************************************/
-
- #include <CPPButton.h>
-
-
- extern Rect kDefaultRect;
- extern Rect kEmptyRect;
-
- CPPButton *TheButton;
-
- /*-----------------------------------------------------------------*/
- /*------------------------ PUBLIC METHODS -------------------------*/
- /*-----------------------------------------------------------------*/
-
- CPPButton::CPPButton (CPPWindow *itsWindow, short ResID,
- Boolean isFramed,
- Boolean canBeTarget,
- Boolean active, Boolean visible) :
- CPPControl (itsWindow, ResID, isFramed, canBeTarget,
- active, visible)
- /* load a control resource and initialize with the given data */
- {
-
- }
-
- /*-----------------------------------------------------------------*/
-
- CPPButton::CPPButton (CPPWindow *itsWindow, Rect *itsBounds,
- StringPtr itsText,
- Boolean isFramed,
- Boolean useWindowFont,
- Boolean canBeTarget,
- Boolean active, Boolean visible) :
- CPPControl (itsWindow, itsBounds, pushButProc,
- itsText, isFramed, useWindowFont,
- canBeTarget, active, visible)
- {
-
- }
-
- /*-----------------------------------------------------------------*/
-
- CPPButton::~CPPButton (void)
- {
- }
-
- /*-----------------------------------------------------------------*/
-
- char *CPPButton::ClassName (void)
- {
- return "CPPButton";
- }
-
- /*-----------------------------------------------------------------*/
-
- void CPPButton::EnableButton (Boolean nowEnabled)
- /* enable or disable the button */
- {
- EnableControl (nowEnabled);
- }
-
- /*-----------------------------------------------------------------*/
-
- void CPPButton::SimulateClick (void)
- /* hilite the control as if it was clicked in */
- {
- long tempLInt;
-
- if (this->theControl && this->IsVisible() && this->isEnabled)
- {
- HiliteControl (this->theControl, inButton);
- Delay(6, &tempLInt);
- HiliteControl (this->theControl, 0);
- this->DoOnClick ();
- }
-
- }
-